<template>
  <!-- 小弹框 width:500,height:0.3,top:15%  -->
  <!-- 中弹框 width:800,height:0.5,top:10% -->
  <!-- 大弹框 width:1060,height:0.76,top:5% -->
  <div class="Control-1 mechanism_dialogS closure" id="comcn small">
    <el-dialog
      v-loading="loading"
      element-loading-text="拼命加载中"
      element-loading-background="rgba(0, 0, 0, 0.2)"
      element-loading-spinner="el-icon-loading"
      width="1060px"
      :title="title"
      v-dialogDrag
      :visible.sync="visible"
      @close="closeDialog"
      :append-to-body="true"
      top="5%"
    >
      <div
        class="dialogBody common commonClassDialog"
        :style="{ height: dialogHeight }"
        style="width: 100%"
      >
        <div class="postionTable">
          <div class="baseTitle">基础信息</div>
          <publicForm
            ref="publicForm"
            lableWidth="100px"
            :formObj="formObj"
            :formData="formData"
            @selectChange="selectChange"
            :selected="[]"
          >
          </publicForm>
        </div>
        <div class="postionTable">
          <div
            class="baseTitle"
            style="
              display: flex;
              justify-content: space-between;
              padding-right: 15px;
            "
          >
            <div>试验属性</div>
            <div
              style="
                height: 100%;
                display: flex;
                justify-content: center;
                align-items: center;
              "
            >
              <el-button
                :disabled="statusNum != 7 ? false : true"
                type="primary"
                @click="addtMachineTesttype"
                >新增</el-button
              >
            </div>
          </div>
          <el-table :data="tableData" style="width: 100%">
            <el-table-column label="序号" type="index" width="50">
            </el-table-column>
            <el-table-column
              prop="fTesttypename"
              label="字段名称"
              align="center"
            >
              <template slot-scope="scope">
                <div class="inputminute">
                  <el-input
                    :disabled="statusNum != 7 ? false : true"
                    v-model="scope.row.fTesttypename"
                    type="text"
                  ></el-input>
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="fIsdict" label="是否字典项" align="center">
              <template slot-scope="scope">
                <div class="selectobject">
                  <el-switch
                    :disabled="statusNum != 7 ? false : true"
                    v-model="scope.row.fIsdict"
                    active-value="是"
                    inactive-value="否"
                  >
                  </el-switch>
                </div>
              </template>
            </el-table-column>
            <el-table-column
              prop="fTesttypedict"
              label="字典项名称"
              align="center"
            >
              <template slot-scope="scope">
                <div class="selectobject">
                  <el-select
                    placeholder="请选择"
                    v-model="scope.row.fTesttypedict"
                    value-key="fId"
                    :disabled="
                      scope.row.fIsdict == '是' && statusNum != 7 ? false : true
                    "
                    @change="function (item) {
                        return selectEquipment(
                          scope.row,
                          scope.row.fTesttypedict,
                          scope.$index
                        );
                      }
                    "
                  >
                    <el-option
                      v-for="(item, index) in fTesttypeData"
                      :label="`${item.label}`"
                      :value="item.value"
                      :key="index"
                    >
                    </el-option>
                  </el-select>
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="fIsedit" label="是否可编辑" align="center">
              <template slot-scope="scope">
                <div class="selectobject">
                  <el-switch
                    :disabled="statusNum != 7 ? false : true"
                    v-model="scope.row.fIsedit"
                    active-value="是"
                    inactive-value="否"
                  >
                  </el-switch>
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="fIsrequired" label="是否必填" align="center">
              <template slot-scope="scope">
                <div class="selectobject">
                  <el-switch
                    :disabled="statusNum != 7 ? false : true"
                    v-model="scope.row.fIsrequired"
                    active-value="是"
                    inactive-value="否"
                  >
                  </el-switch>
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="fIsshow" label="是否显示" align="center">
              <template slot-scope="scope">
                <div class="selectobject">
                  <el-switch
                    :disabled="statusNum != 7 ? false : true"
                    v-model="scope.row.fIsshow"
                    active-value="是"
                    inactive-value="否"
                  >
                  </el-switch>
                </div>
              </template>
            </el-table-column>

            <el-table-column prop="fOrder" label="排序号" align="center">
              <template slot-scope="scope">
                <div class="inputminute">
                  <el-input
                    :disabled="statusNum != 7 ? false : true"
                    v-model="scope.row.fOrder"
                    type="text"
                  ></el-input>
                </div>
              </template>
            </el-table-column>
          </el-table>
        </div>
        <div class="postionTable">
          <div class="baseTitle">试验环境</div>
          <div class="wh">
            <div class="title">环境条件</div>
            <div class="content">
              <div>温度</div>
              <div>20</div>
              <div>℃</div>
              <div>相对湿度</div>
              <div>65</div>
              <div>%</div>
            </div>
          </div>
        </div>
        <div class="postionTable">
          <div class="baseTitle">试验设置</div>
          <div class="regular">
            <publicForms
              ref="publicForm0"
              lableWidth="100px"
              :formObj="tableObj"
              :formData="formData"
              :selected="[]"
              @selectChange="selectChange"
            >
            </publicForms>
          </div>
          <div class="illustrate">
            <div class="text">计算说明</div>
            <div class="form">
              <el-form ref="form" :model="formData" label-width="80px">
                <el-form-item label="面积计算">
                  <el-input
                    :disabled="statusNum != 7 ? false : true"
                    v-model="formData.fAreacalculation"
                  ></el-input>
                  <el-input
                    :disabled="statusNum != 7 ? false : true"
                    v-model="formData.fAreacalculationnote"
                  ></el-input>
                </el-form-item>
                <el-form-item label="强度计算">
                  <el-input
                    :disabled="statusNum != 7 ? false : true"
                    v-model="formData.fIntensitycalculations"
                  ></el-input>
                  <el-input
                    :disabled="statusNum != 7 ? false : true"
                    v-model="formData.fIntensitycalculationsnote"
                  ></el-input>
                </el-form-item>
              </el-form>
            </div>
          </div>
        </div>
      </div>
      <div class="newlyAdded_btn" v-if="btnShow">
        <el-button :disabled="isLock" type="primary" @click="yj_saveForm(1)"
          >保存</el-button
        >
        <el-button type="warning" @click="visible = false">关闭</el-button>
      </div>
    </el-dialog>
    <custom-dialog
      @refreshList="refreshList"
      v-if="isShow"
      :dialogVisible="isShow"
      @close1="testDialog"
      @getInfo="getTestType"
    ></custom-dialog>
  </div>
</template>
<script src="./index.js"></script>
<style lang="less" scoped>
@import "./index.less";
</style>
